package com.hotle.base.dao;

import java.util.List;
import java.util.Map;

import com.hotle.base.utils.Page;

public interface IBaseDao<T>{
	/**
     * 鎻掑叆鏁版嵁
     * 
     * @param e
     *            瀹炰綋绫�
     * @return 涓婚敭鍊�
     */
    public int insert(T e);
 

 
    /**
     * 鏇挎崲鏁版嵁
     * 
     * @param e
     *            瀹炰綋绫�
     * @return 涓婚敭鍊�
     */
    public long replace(T e);
 
   
 
 
 
    /**
     * 鏍规嵁涓婚敭鏇存柊鏁版嵁
     * 
     * @param e
     *            鏂版暟鎹�
     * @param primary
     *            涓婚敭鍊�
     */
    public int updateById(T e);
 
   
 
    /**
     * 鑾峰彇涓�鏉¤褰�
     * 
     * @param conditions
     *            鏌ヨ鏉′欢
     * @param offset
     *            鍋忕Щ閲�
     * @return 鏌ヨ缁撴灉
     */
    public T getOne(T entity);
 
 
 
    /**
     * 鏁版嵁鏌ヨ
     * 
     * @param conditions
     *            鏌ヨ鏉′欢
     * @return 缁撴灉闆�
     */
    public List<T> select(T entity);
 
 
    /**
     * 鏁版嵁鍒嗛〉鏌ヨ
     * 
     * @param conditions
     *            鏌ヨ鏉′欢
     * @param page
     *            椤电爜
     * @param pagesize
     *            姣忛〉澶у皬
     * @return Pagination
     */
    public Page<T> page(T entity, int page, int pagesize);
 
    /**
     * 鏍规嵁涓婚敭鏌ヨ鏁版嵁
     * 
     * @param primary
     *            涓婚敭鍊�
     * @return 鏁版嵁缁撴灉
     */
    public T getById(String id);
 
    /**
     * 鏌ヨ鎵�鏈夋暟鎹�
     * 
     * @return 缁撴灉闆�
     */
    public List<T> getAll();
 
    /**
     * 鏁版嵁璁板綍鎬绘暟
     * 
     * @param conditions
     *            鏌ヨ鏉′欢
     * @return 璁板綍鎬绘暟
     */
    public int count(T entity);
 
    /**
     * 鍒犻櫎鏁版嵁
     * 
     * @param conditions
     *            鍒犻櫎鏉′欢
     * @return 褰卞搷鏉℃暟
     */
    public int delete(T entity);
 
    /**
     * 鏍规嵁涓婚敭鍒犻櫎鏁版嵁
     * 
     * @param primary
     *            涓婚敭鍊�
     * @return 褰卞搷鏉℃暟
     */
    public int deleteByPrimary(String primary);
 
    /**
     * 娓呯┖鏁版嵁
     * 
     * @return 褰卞搷鏉℃暟
     */
    public int clear();
    
    /**
     * 鏌ヨ鎵�鏈夋暟鎹�
     * @return
     */
    public List<T> findAllList();
}
